<?php declare(strict_types=1);


namespace App\Model\Entity;

use Swoft\Db\Annotation\Mapping\Column;
use Swoft\Db\Annotation\Mapping\Entity;
use Swoft\Db\Annotation\Mapping\Id;
use Swoft\Db\Eloquent\Model;


/**
 * 
 * Class Friend
 *
 * @since 2.0
 *
 * @Entity(table="friend")
 */
class Friend extends Model
{
    /**
     * 
     * @Id()
     * @Column()
     *
     * @var int
     */
    private $rid;

    /**
     * from user_id or team_id
     *
     * @Column()
     *
     * @var int
     */
    private $fid;

    /**
     * to user_id or team_id
     *
     * @Column()
     *
     * @var int
     */
    private $tid;

    /**
     * the last message update or async_time
     *
     * @Column(name="async_time", prop="asyncTime")
     *
     * @var int
     */
    private $asyncTime;

    /**
     * 
     *
     * @Column(name="is_team", prop="isTeam")
     *
     * @var int
     */
    private $isTeam;

    /**
     * un read message count
     *
     * @Column()
     *
     * @var int|null
     */
    private $unread;

    /**
     * 
     *
     * @Column(name="last_msg", prop="lastMsg")
     *
     * @var string|null
     */
    private $lastMsg;

    /**
     * 
     *
     * @Column(name="created_at", prop="createdAt")
     *
     * @var int
     */
    private $createdAt;

    /**
     * 0: I to you in domain_group
1: You to me in domain_group
2: I to you with search
3: You to me with search
4: from team.
     *
     * @Column(name="raletion_type", prop="raletionType")
     *
     * @var int|null
     */
    private $raletionType;


    /**
     * @param int $rid
     *
     * @return void
     */
    public function setRid(int $rid): void
    {
        $this->rid = $rid;
    }

    /**
     * @param int $fid
     *
     * @return void
     */
    public function setFid(int $fid): void
    {
        $this->fid = $fid;
    }

    /**
     * @param int $tid
     *
     * @return void
     */
    public function setTid(int $tid): void
    {
        $this->tid = $tid;
    }

    /**
     * @param int $asyncTime
     *
     * @return void
     */
    public function setAsyncTime(int $asyncTime): void
    {
        $this->asyncTime = $asyncTime;
    }

    /**
     * @param int $isTeam
     *
     * @return void
     */
    public function setIsTeam(int $isTeam): void
    {
        $this->isTeam = $isTeam;
    }

    /**
     * @param int|null $unread
     *
     * @return void
     */
    public function setUnread(?int $unread): void
    {
        $this->unread = $unread;
    }

    /**
     * @param string|null $lastMsg
     *
     * @return void
     */
    public function setLastMsg(?string $lastMsg): void
    {
        $this->lastMsg = $lastMsg;
    }

    /**
     * @param int $createdAt
     *
     * @return void
     */
    public function setCreatedAt(int $createdAt): void
    {
        $this->createdAt = $createdAt;
    }

    /**
     * @param int|null $raletionType
     *
     * @return void
     */
    public function setRaletionType(?int $raletionType): void
    {
        $this->raletionType = $raletionType;
    }

    /**
     * @return int
     */
    public function getRid(): ?int
    {
        return $this->rid;
    }

    /**
     * @return int
     */
    public function getFid(): ?int
    {
        return $this->fid;
    }

    /**
     * @return int
     */
    public function getTid(): ?int
    {
        return $this->tid;
    }

    /**
     * @return int
     */
    public function getAsyncTime(): ?int
    {
        return $this->asyncTime;
    }

    /**
     * @return int
     */
    public function getIsTeam(): ?int
    {
        return $this->isTeam;
    }

    /**
     * @return int|null
     */
    public function getUnread(): ?int
    {
        return $this->unread;
    }

    /**
     * @return string|null
     */
    public function getLastMsg(): ?string
    {
        return $this->lastMsg;
    }

    /**
     * @return int
     */
    public function getCreatedAt(): ?int
    {
        return $this->createdAt;
    }

    /**
     * @return int|null
     */
    public function getRaletionType(): ?int
    {
        return $this->raletionType;
    }

}
